package com.qire.manhua.activity;

import android.os.Bundle;

import com.qire.antscore.annotation.RouteMapping;
import com.qire.antsrouter.inject.Autowired;
import com.qire.common.constant.Navigation;
import com.qire.common.inject.EventControllerInjector;
import com.qire.common.inject.ViewModelInjector;
import com.qire.common.model.entity.UserEntity;
import com.qire.common.support.base.BaseActivity;
import com.qire.common.support.base.ProxyViewModel;
import com.qire.common.utils.ThemeUtil;
import com.qire.manhua.R;
import com.qire.manhua.controller.AccountController;
import com.qire.manhua.databinding.ActivityAccountBinding;
import com.qire.manhua.model.viewModel.IAccountViewModel;

import androidx.annotation.Nullable;

@RouteMapping(path = Navigation.Page.AccountPage)
public class AccountActivity extends BaseActivity<ActivityAccountBinding> {

    @Autowired(injector = ViewModelInjector.class)
    ProxyViewModel<IAccountViewModel>  viewModel;

    @Autowired(injector = EventControllerInjector.class)
    AccountController controller;

    @Override
    public int layoutRid() {
        return R.layout.activity_account;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ThemeUtil.changeStatusBarLightOrDark(this, true, true);
    }

    @Override
    protected void onResume() {
        super.onResume();

        viewModel.set("coinText", "金币：" + UserEntity.self.getCoinBalance());
        viewModel.set("beanText", "金豆：" + UserEntity.self.getBeanBalance());
    }
}
